<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function foo() { }
    var foo2 = function (name, age) {
      console.log("函数:", this, arguments)
      console.log(name, age)
    }
    foo2("why", 18)

    // 箭头函数(完整写法)
    var foo3 = (name, age) => { console.log(name, age) }

    var names = ["abc", "cba", "nba", "mba"]
    names.forEach((item, index, array) => console.log(item, index, array))

    setTimeout(() => { console.log("3秒钟后") }, 3000)
    

  </script>
</body>

</html>